/**
 * Created by XGJ on 2017/9/19.
 */

import {Component, Input,Output,EventEmitter} from '@angular/core';

@Component({
    selector:'home-cell',
    templateUrl:'homecell.html'
})

export class HomeCell{
    @Input()
    cellModel:Object;  //存放数据的model
    @Input()
    cellIndex:number;  //该cell所在的位置

    @Output()
    cellClick = new EventEmitter<number>();//点击cell触发的事件
    @Output()
    likeClick = new EventEmitter<number>();//点击like的处罚方法

    constructor(){

    }
    cellSelect(){
        this.cellClick.emit(this.cellIndex);
    }
    likeSelect(){
        event.stopPropagation();
        this.likeClick.emit(this.cellIndex);
    }
}